package sol.leetcode;

import def.TreeNode;

/**
 * Same Tree
 * Created by lkk on 2016/8/28.
 */
public class Issue100 {
    boolean isSameTree(TreeNode p, TreeNode q) {
        if (p == null || q == null)
            return p == null && q == null;
        return p.val == q.val && isSameTree(p.left, q.left) && isSameTree(p.right, q.right);
    }
}
